﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace HamcoWcs.Entitys.Devices
{
    public class RasterConfig : IEntityTypeConfiguration<Raster>
    {

        public void Configure(EntityTypeBuilder<Raster> builder)
        {
            builder.HasComment("安全光栅配置表");
            builder.Property(x => x.Name).IsRequired().HasMaxLength(45).HasComment("光栅名");
            builder.Property(x => x.ErrorOffset).IsRequired().HasMaxLength(45).HasComment("异常DB偏移量");
            builder.Property(x => x.BypassReadOffset).IsRequired().HasMaxLength(45).HasComment("BypassDB读取偏移量，DB103");
            builder.Property(x => x.BypassWriteOffset).IsRequired().HasMaxLength(45).HasComment("BypassDB写入偏移量，Db104");
            builder.Property(x => x.MachinePosition).HasMaxLength(45).IsRequired(false).HasDefaultValue("").HasComment("设备位置");
            builder.Property(x => x.Remark).HasMaxLength(255).IsRequired(false).HasDefaultValue("").HasComment("备注");
        }
    }
}
